import rospy
from nav_msgs.msg import OccupancyGrid

rospy.init_node("map_test")

def map_call_back(data):
    rospy.loginfo("订阅地图......")

if __name__ == "__main__":
    sub = rospy.Subscriber("/map", OccupancyGrid, callback=map_call_back)
    rospy.spin()
